/**
 * 功能说明:
 * 功能作者:
 * 创建日期:
 */
package com.jml.APIOauth2.controller;

import com.jml.APIOauth2.Mapper.AppMapper;
import com.jml.APIOauth2.base.BaseApiService;
import com.jml.APIOauth2.base.ResponseBase;
import com.jml.APIOauth2.entity.AppEntity;
import com.jml.APIOauth2.utils.BaseRedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/openApi")
public class MemberController extends BaseApiService {

	@Autowired
	private BaseRedisService baseRedisService;
	@Autowired
	private AppMapper appMapper;
	//获取对应的
	@RequestMapping("/getUser")
	public ResponseBase getUser(String accessToken) {
		//这些放在拦截器中
		/*if(StringUtils.isEmpty(accessToken)){
			return setResultError("accessToken  is  null");
		}
		String appid = (String)baseRedisService.getString(accessToken);
		if(StringUtils.isEmpty(appid)){
			return setResultError("appid  is  Invalid");
		}
		AppEntity appResult = appMapper.findAppId(appid);
		if(appResult==null){
			return setResultError("not  found  by appid");
		}
		int isFlag = appResult.getIsFlag();
		if(isFlag==1){
			return setResultError("权限不足 no auth to operator");
		}*/
		//调用真实的业务场景
		return setResultSuccess("调用真实的业务场景,获取会员信息接口...");
	}
}
